package com.etc.dao;

import com.etc.entity.Record;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

@Repository
public interface RecordDao extends JpaRepository<Record, Integer>, Serializable {
    @Query(value = "select count(*) " +
            "from record inner join `user` on  record.userid = user.userid " +
            "where `user`.username like ?1", nativeQuery = true)
    int getCount(String username);

}
